<div class="portlet x12">
    <div class="portlet-header"><h4>Categorías</h4></div>
    <div class="portlet-content">
        <h2>Listado de categorías</h2>
        <?php echo $this->Html->link('Insertar nuevo registro',array('action'=>'new')); ?>
        <br /><br />
        <?php if(!empty($categories)){ ?>
            <table cellpadding="0" cellspacing="0" border="0" class="display" rel="datatable" id="example">
                <thead>
                    <tr>
                        <th>Nombre</th>
                        <!-- <th>Categoría padre</th> -->
                        <th>Creado</th>
                        <th>Acciones</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach($categories as $category){ ?>
                        <tr class="odd gradeX">
                            <td><?php echo $category['Category']['name']; ?></td>
                            <!-- <td><?php echo $category['Category']['category_id']; ?> </td> -->
                            <td><?php echo $category['Category']['created']; ?></td>
                            <td>
                                <?php echo $this->Html->link('Editar',array('action'=>'edit',$category['Category']['id'])); ?>
                                <?php echo $this->Html->link('Eliminar',array('action'=>'delete',$category['Category']['id']),null,"Esta seguro que quiere eliminar este registro?"); ?>
                            </td>
                        </tr>
                    <?php } ?>
                </tbody>
            </table>
        <?php }else{ ?>
            <b>No existen categorías.</b>
        <?php } ?>
    </div>
</div>